<?PHP
// ============= Persistence layer ============
namespace DB
{
	class Oracle
	{
       private $userName = "TEST_TRUNK_SC";
       private $pass = "Remarks";
       private $dbInfo = "192.168.10.200/U11TEST";
		
		public function __construct($userName, $password, $dbInfo)
		{
         $this->userName = $userName;
			$this->pass = $password;
			$this->dbInfo = $dbInfo;
		}

		public function query($sql, $args=array())
		{
         $conn = oci_connect($this->userName, $this->pass, $this->dbInfo);

         $stid = oci_parse($conn, $sql);

         foreach ($args as $key => $value)
         {
            oci_bind_by_name($stid, $key, $value);
         }

         oci_execute($stid);

         $res = array();
         while ($row = oci_fetch_array($stid, OCI_ASSOC))
         {
            $res[] = $row;
         }

         return $res;
		}
	}
}